<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      class="content-parent"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style8/Level2outlineStyle4Bg.webp'})`,
      }"
    >
      <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
        <!-- digitalShowroom -->
        <digitalShowroomIcon :url="props.info.digitalShowroom" />
      </div>

      <div
        class="content"
        :class="{
          content2: props.info.value && props.info.remarks && !props.info.subTitle,

          content3: !props.info.value && props.info.remarks && props.info.subTitle,
          content4: !props.info.value && props.info.remarks && !props.info.subTitle,
          content6: !props.info.value && !props.info.remarks && !props.info.subTitle,
          content5: props.info.value && !props.info.remarks && !props.info.subTitle
        }"
      >
        <!-- 标题 -->

        <div
          class="title"
          :style="{
            backgroundImage: `url(${
              publicUrls + 'free/style8/Level2outlineStyle4BgTitle.webp'
            })`,
          }"
        >
          <span class="title-content">{{ props.info.text }}</span>
        </div>

        <!-- 内容区 -->
        <div class="subtitle" v-if="props.info.subTitle">
          {{ props.info.subTitle }}
        </div>
        <div
          class="img-box"
          v-if="props.info.value"
          :style="{
            backgroundImage: `url(${
              publicUrls + 'free/style8/Level2outlineStyle4BgCover.webp'
            })`,
          }"
        >
          <img
            class="outline-cover"
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
          />
        </div>
        <div
          class="img-box img-box-2"
          v-if="!props.info.value && !props.info.remarks"
          :style="{
            backgroundImage: `url(${
              publicUrls + 'free/style8/Level2outlineStyle4BgCover.webp'
            })`,
          }"
        ></div>
        <div class="remarks1" v-if="props.info.value && props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="3"
          ></TextMax>
        </div>
        <div
          class="remarks2"
          v-else-if="props.info.remarks"
          :class="{
            remarks3: !props.info.subTitle,
          }"
        >
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="props.info.subTitle ? 12 : 12"
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style24',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import { publicUrls, textType } from '@/utils/minxin';
import textMode from '../../../textMode/textMode.vue';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style8.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 100%;
  margin-left: 80px;
  margin-right: 90px;
  margin-top: 0;
}
.content-parent {
  position: relative;
  display: flex;
  //   flex-direction: column;
  //   justify-content: center;
  width: 470px;
  height: 754px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0px 50px 61px 40px;
}
.content {
  display: flex;
  flex-direction: column;
  //   justify-content: center;
  position: relative;
  width: 380px;
}

.title {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  width: 325px;
  position: relative;
  z-index: 5;
  margin-left: 33px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 16px 63px;
  padding-right: 70px;
  margin-top: -20px;
  .title-content {
    max-width: 192px;
    font-family: SourceBold;
    font-size: 24px;
    line-height: 24px;
    // background: linear-gradient(19.17602887052617deg, rgba(251, 245, 146, 1) 0%, rgba(204, 176, 94, 1) 100%);
    //  -webkit-background-clip: text;
    //             background-clip: text;
    color: rgba(251, 245, 146, 1);
    text-shadow: 0px 3px 2px rgba(0, 0, 0, 0.5), 0px -1px 1px rgba(0, 0, 0, 0.15);
    text-align: center;
  }
}

.subtitle {
  margin-left: 37px;
  width: 306px;
  font-family: SourceMedium;
  font-size: 18px;
  color: #4f6e5c;
  line-height: 24px;
  text-align: center;
  opacity: 0.8;
  margin-top: 29px;
}
.img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 380px;
  height: 380px;
  margin-top: 50px;
  overflow: hidden;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.outline-cover {
  width: 314.86px;
  height: 314.86px;
  object-fit: cover;
  transition: all 0.3s;
  border-radius: 50%;
}

.content2 {
  .img-box {
    margin-top: 88px;
  }
}
.content3 { 
  .remarks2 {
    margin-top: 137px;
  }
}
.content4 {
  .remarks2 { 
    margin-top: 214px; 
  }
}
.content5{
    .img-box {
    margin-top: 137px;
  }
}
.content6 {
  .img-box-2 {
    margin-top: 137px;
  }
}
// .outline-cover:hover {
//   transform: scale(1.1);
// }
.img-box-2 {
}
.remarks1 { 
  position: relative;
  width: 380px;
  margin-top: 20px;
}
.remarks2 {
  position: relative;
  width: 380px;
  margin-top: 20px;
}
.digitalShowroom-p {
  width: 46px; 
  height: 46px;
  position: absolute;
  top: 15px;
  left: 20px;

  z-index: 15;
}

::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: rgba(255, 255, 255, 1) !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>